<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/8/23
 * Time: 13:51
 */

namespace app\admin\controller;
use       think\Controller;
use       think\Db;
use       think\Request;

class Examine extends Controller
{
    //初始化函数
    public function _initialize()
    {

    }
    //审核列表
    public function examine_list()
    {
        $list =Db::table('x_bce_list')->select();
        $count=Db::table('x_bce_list')->count();
        $this->assign('count',$count);
        $this->assign('list',$list);
        return $this->fetch();
    }
    //审核通过
    public function examine_pass()
    {
        $bce_id =Request::instance()->post('bce_id');
        $Data   = array('status'=>1);
        //更新状态
        $Offest =Db::table('x_bce_list')->where('bce_id=:bce_id',['bce_id'=>$bce_id])->update($Data);
        //创建房间
        //返回操作数据库状态
        if($Offest){return json(['code'=>1]);}else{return json(['code'=>0]);}
    }
    //审核拒绝
    public function examine_stop()
    {
        $bce_id =Request::instance()->post('bce_id');
        $Data   = array('status'=>-1);
        //更新状态
        $Offest =Db::table('bce_id_list')->where('bce_id=:bce_id',['bce_id'=>$bce_id])->update($Data);
        //返回操作数据库状态
        if($Offest){return json(['code'=>1]);}else{return json(['code'=>0]);}
    }
}

?>